/**
 * 
 */
package com.vision.sales.cl.ui.component;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfigBean;
import com.sencha.gxt.data.shared.loader.PagingLoadConfig;
import com.vision.core.cm.db.data.Company;
import com.vision.sales.cm.data.CollectionStatus;
import com.vision.sales.cm.data.CreditMemoType;
import com.vision.sales.cm.data.DebitMemoType;
import com.vision.sales.cm.data.TransactionStatus;
import com.vision.sales.cm.data.TransactionType;
import com.vision.sales.cm.db.data.Customer;
import com.vision.sales.cm.db.data.Product;
import com.vision.sales.cm.db.data.Salesman;

/**
 * @author Mark
 *
 */
public class TransactionLoadConfig extends FilterPagingLoadConfigBean {

	private static final long serialVersionUID = 1L;
	
	// Common filtering fields
	private List<Company> companies;
	private Date start;
	private Date end;
	private List<TransactionStatus> statuses;
	private List<Product> products;
	private List<Salesman> salesmen;
	private List<Customer> customers;
	
	// DeliveryReceipt-specific filtering fields
	private Boolean invoiced;
	
	// SaleInvoice-specific filtering fields
	private List<CollectionStatus> collectionStatuses;
	
	// CreditMemo-specific filtering fields
	private List<CreditMemoType> creditMemoTypes;
	
	// DebitMemo-specific filtering fields
	private List<DebitMemoType> debitMemoTypes;
	
	// Collection-specific filtering fields
	
	// TransactionEntry-specific fields
	private List<TransactionType> types;
	
	private boolean includeZeros = false;
	
	// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	
	public TransactionLoadConfig() {
		
	}
	
	public TransactionLoadConfig(PagingLoadConfig config) {
		setOffset(config.getOffset());
		setLimit(config.getLimit());
	}
	
	// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	
	public List<Company> getCompanies() {
		return companies;
	}

	public void setCompanies(List<Company> companies) {
		this.companies = companies;
	}

	public Date getStart() {
		return start;
	}

	public void setStart(Date start) {
		this.start = start;
	}

	public Date getEnd() {
		return end;
	}

	public void setEnd(Date end) {
		this.end = end;
	}

	public List<TransactionStatus> getStatuses() {
		return statuses;
	}

	public void setStatuses(List<TransactionStatus> statuses) {
		this.statuses = statuses;
	}
	
	public void setStatuses(TransactionStatus... statuses) {
		this.statuses = Arrays.asList(statuses);
	}
	
	public List<Product> getProducts() {
		return products;
	}
	
	public void setProducts(List<Product> products) {
		this.products = products;
	}
	
	public List<Salesman> getSalesmen() {
		return salesmen;
	}
	
	public void setSalesmen(List<Salesman> salesmen) {
		this.salesmen = salesmen;
	}
	
	public List<Customer> getCustomers() {
		return customers;
	}
	
	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}

	public Boolean isInvoiced() {
		return invoiced;
	}

	public void setInvoiced(Boolean invoiced) {
		this.invoiced = invoiced;
	}

	public List<CollectionStatus> getCollectionStatuses() {
		return collectionStatuses;
	}

	public void setCollectionStatuses(List<CollectionStatus> collectionStatuses) {
		this.collectionStatuses = collectionStatuses;
	}

	public List<CreditMemoType> getCreditMemoTypes() {
		return creditMemoTypes;
	}

	public void setCreditMemoTypes(List<CreditMemoType> creditMemoTypes) {
		this.creditMemoTypes = creditMemoTypes;
	}

	public List<DebitMemoType> getDebitMemoTypes() {
		return debitMemoTypes;
	}

	public void setDebitMemoTypes(List<DebitMemoType> debitMemoTypes) {
		this.debitMemoTypes = debitMemoTypes;
	}

	public List<TransactionType> getTypes() {
		return types;
	}

	public void setTypes(List<TransactionType> types) {
		this.types = types;
	}
	
	public boolean isIncludeZeros() {
		return includeZeros;
	}
	
	public void setIncludeZeros(boolean includeZeros) {
		this.includeZeros = includeZeros;
	}

}
